package com.zjw.designPattern.singleton;

/**
 * 懒汉式，线程安全(双重检查，推荐使用)
 * */
public class SingletonDCL {

    private SingletonDCL() {
    }

    public static SingletonDCL singletonDCL;

    public SingletonDCL getSingletonDCL() {

        if (singletonDCL == null) {
            synchronized (singletonDCL) {
                if (singletonDCL == null) {
                    singletonDCL = new SingletonDCL();
                }
            }
        }
        return singletonDCL;
    }
}
